package com.example.entity.vo.hzView;

import com.example.untils.StringUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;

@Data
@ApiModel("HzBommfView")
public class HzBommfView {

    private String MF001;
    private String MF002;
    private String MF003;
    private String MF004;
    private String MF005;
    private String MF006;
    private String MF007;
    private String IsDefault;
    private String inproductno;
    private String Modified_Time;
    private String create_time;
    private String ME003;
    private String invrt_name;

    /**
     * 自定义对象是否相等
     * @param obj
     * @return
     */
    @Override
    public boolean equals(Object obj) {
        // 自反性检查
        if (this == obj) {
            return true;
        }
        // 类型检查
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        HzBommfView other = (HzBommfView) obj;
        // 属性比较  MF001, MF002, MF003, IsDefault, invrt_name
        if(StringUtils.isEmpty(MF001) || StringUtils.isEmpty(other.MF001)) return false;
        if(StringUtils.isEmpty(MF002) || StringUtils.isEmpty(other.MF002)) return false;
        if(StringUtils.isEmpty(MF003) || StringUtils.isEmpty(other.MF003)) return false;
        if(StringUtils.isEmpty(IsDefault) || StringUtils.isEmpty(other.IsDefault)) return false;
        if(StringUtils.isEmpty(invrt_name) || StringUtils.isEmpty(other.invrt_name)) return false;
        if(StringUtils.isEmpty(inproductno) || StringUtils.isEmpty(other.inproductno)) return false;

        if(!MF001.trim().equals(other.MF001.trim())) return false;
        if(!MF002.trim().equals(other.MF002.trim())) return false;
        if(!MF003.trim().equals(other.MF003.trim())) return false;
        if(!IsDefault.trim().equals(other.IsDefault.trim())) return false;
        if(!invrt_name.trim().equals(other.invrt_name.trim())) return false;
        if(!inproductno.trim().equals(other.inproductno.trim())) return false;
        return true;
    }

    /**
     * 用于Map,Set中的hash值比较
     * @return
     */
    @Override
    public int hashCode() {
        // 使用一个常数乘以每个属性的哈希值
        int result = 17; // 选择一个非零常数
        result = 31 * result + (MF001 != null ? MF001.hashCode() : 0);
        result = 31 * result + (MF002 != null ? MF002.hashCode() : 0);
        result = 31 * result + (MF003 != null ? MF003.hashCode() : 0);
        result = 31 * result + (IsDefault != null ? IsDefault.hashCode() : 0);
        result = 31 * result + (invrt_name != null ? invrt_name.hashCode() : 0);
        result = 31 * result + (inproductno != null ? inproductno.hashCode() : 0);
        return result;
    }


}
